package csel.controller.commands;

import csel.controller.Controller;
import csel.model.GameCommand;
import csel.model.GameFactory;
import csel.model.Model;
import csel.view.NewGameDialog;

public class SPNewGameCommand implements GameCommand
{
	private Model model;
	private Controller controller;

	public SPNewGameCommand(Model model, Controller controller)
	{
		this.model = model;
		this.controller = controller;
	}

	public void execute()
	{
		NewGameDialog newGameDialog = new NewGameDialog();
		if (newGameDialog.show())
		{
			GameFactory.makeNewGame(newGameDialog.getOccupation(),
					newGameDialog.getName(), model);
			controller.createGameViewport();
			controller.destroySplasher();
		}
	}
}
